<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
		<nav class="navbar navbar-inverse navbar-fixed-top">
			<div class="container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="index">TyEnWord</a>
				</div>
				<div id="navbar" class="navbar-collapse collapse">
					<ul class="nav navbar-nav">
<%
String cur =request.getParameter("cur");
String format = "<li %s><a href=\"index\">Home</a></li>\n"
				+ "<li %s><a href=\"copyright\">Copyright</a></li>\n";
String[] strs = {"", ""};
if (cur != null)
{
	if (cur.equals("home"))
		strs[0] = "class=\"active\"";
	else if (cur.equals("copyright"))
		strs[1] = "class=\"active\"";
}
out.println(String.format(format, strs));
%>
						<li ><a href="http://git.oschina.net/luckytianyiyan" target="_blank">Git@OSC</a></li>
						<li ><a href="http://tianyiyan.com" target="_blank">Visit Author Site</a></li>
					</ul>
<s:if test="#session.username == null or $session.username == ''">
					<ul class="navbar-form navbar-right">
			            <a href="login" class="btn btn-info">Login</a>
			            <a href="signup" class="btn btn-primary">Sign Up</a>
					</ul>
</s:if>
<s:else>
					<ul class="nav navbar-nav navbar-right">
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><s:property value="#session.username"/><span class="caret"></span></a>
							<ul class="dropdown-menu" role="menu">
								<!-- <li><a href="#">个人资料</a></li>
								<li class="divider"></li> -->
								<li><a href="logout">Log out</a></li>
							</ul>
						</li>
					</ul>
</s:else>
				</div>
				<!--/.nav-collapse -->
			</div>
		</nav>